{extend name="public/base"/}
{block name="body"}
<div class="main-box no-header clearfix">
	<header class="main-box-header clearfix">
		<div class="pull-left">
			<h2>{$meta_title}</h2>
		</div>
		<div class="pull-right">
			<a href="{:url('addagent')}" class="btn btn-primary pull-right"> <i class="fa fa-plus-circle fa-lg"></i> 新增代理</a>
		</div>
	</header>
	<div class="main-box-body clearfix">
		<div class="row">
			<form method="get">
				<div class="col-sm-12 col-md-4 col-lg-3">
					<input type="text" class="form-control" name="keyword" value="{$keyword|default=''}" placeholder="请输入关键字">
				</div>
				<div class="col-sm-12 col-md-4 col-lg-3">
					<select name="level" id="level" class="form-control">
						<option value="">请选择等级</option>
						<option value="0" {if $level=="0"}selected {/if}>待定</option>
						<option value="1" {if $level=="1"}selected {/if}>差</option>
						<option value="2" {if $level=="2"}selected {/if}>良</option>
						<option value="3" {if $level=="3"}selected {/if}>优</option>
					</select>
				</div>
				
				<div class="col-sm-12 col-md-4">
					<button class="btn btn-primary" type="submit">搜索</button>
				</div>
			</form>
			<div class="col-sm-12 col-md-12">
				<h4 style="float: right;">
					今日用户总充值(¥)：{$today_all_user}&nbsp;&nbsp;今日新用户总充值(¥)：{$today_new_user}
				</h4>
			</div>
		</div>
		<div class="table-responsive">
			<table class="table user-list table-hover">
				<thead>
					<tr>
						<th>
							<span>ID</span>
						</th>
						<th>
							<span>用户名</span>
						</th>
						<th>
							<span>级别</span>
						</th>
						<!--
						<th>
							<span>佣金比例</span>
						</th>
						-->
						<th>
							<span>开户人</span>
						</th>
						<th>
							<span>等级</span>
						</th>
						<th class="text-center">
							<span>状态</span>
						</th>
						<th>
							<span>注册时间</span>
						</th>
						<th>
							<span>今日充值</span>
						</th>
						<th>
							<span>今日新用户充值</span>
						</th>
						<th>
							<span>昨日充值</span>
						</th>
						<th>
							<span>昨日新用户充值</span>
						</th>
						<th>
							<!--<span>结算单总额</span>-->
							<span>上上月充值</span>
						</th>
						<th>
							<!--<span>未提现总额（不含当日）</span>-->
							<span>上月充值</span>
						</th>
						<th>
							<span>本月充值</span>
						</th>
						<th>
							<span>总充值金额</span>
						</th>

						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					{volist name="list" id="item"}
					<tr>
						<td>{$item['uid']}</td>
						<td>
							{$item['username']}
							<!---
							<img src="{:avatar($item['uid'])}" alt=""/>
							<a href="#" class="user-link">{$item['nickname']}</a>
							<span class="user-subhead">{$item['username']}</span>
							---->
						</td>
						<td>
							{if $item.is_top == 1}
								<span >渠道商</span>
							{else}
								<span >代理商</span>
							{/if}
						</td>
						<!--
						<td>
							<span >{$item['percentage']}</span>
						</td>
						-->
						<td>
							{if $item.is_top == 1}
								admin
							{else}
								{$item.s_uid|get_username}
							{/if}
						</td>
						<td>
							{switch name="item.level" }
								{case value="0"}待定{/case}
								{case value="1"}差{/case}
								{case value="2"}良{/case}
								{case value="3"}优{/case}
								{default /}待定
							{/switch}
						</td>
						<td class="text-center">
							{if condition="$item['status']"}
							<span class="label label-primary">启用</span>
							{else/}
							<span class="label label-danger">禁用</span>
							{/if}
						</td>
						<td>
							<span >{$item['reg_time']|date='Y-m-d',###}</span>
						</td>

						<td>
							<span >{$item['todayPay']}</span>
						</td>
						<td>
							<span >{$item['income_today']}</span>
						</td>

						<td>
							<span >{$item['yesterdayPay']}</span>	
						</td>
						<td>
							<span >{$item['income_yestoday']}</span>
						</td>

						<td>
							<span >{$item['beforelast']}</span>
						</td>

						<td>
							<!--<span >{$item['balmoney']}</span>-->
							<span >{$item['lastmonth']}</span>
						</td>

						<td>
							<!--<span >{$item['wmoney']}</span>-->
							<span >{$item['monthPay']}</span>
						</td>
						<td>
							<span >{$item['allPay']}</span>
						</td>

						<td>
						
							<a href="{:url('User/percentage',array('id'=>$item['uid']))}" class="table-link" title="">
								抽成设置
							</a>
							<a href="{:url('User/gathering',array('id'=>$item['uid']))}" class="table-link" title="">
								收款信息
							</a>
							<a href="{:url('User/level',array('id'=>$item['uid']))}" class="table-link" title="">
								等级划分
							</a>
							{if $group==999}
							<a href="{:url('User/agentedit',array('id'=>$item['uid']))}" class="table-link" title="">
								编辑
							</a>
							<!----------
							<a href="{:url('User/auth',array('id'=>$item['uid']))}" class="table-link">
								授权
							</a>
							------->
							<a href="{:url('User/del',array('id'=>$item['uid']))}" class="table-link confirm ajax-get">
								删除
							</a>
							{/if}
						</td>
					</tr>
					{/volist}
				</tbody>
			</table>
			{$page}
		</div>
	</div>
</div>
{/block}